package org.wk.logger.domain;

import org.hibernate.annotations.GenericGenerator;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.wk.core.db.domain.BaseEntity;

import javax.persistence.*;

/**
 * 日志
 * @author df.wu
 */
@Entity(name="org.wk.logger.domain.LogEntity")
@Table(name="s_sys_log")
public class LogEntity extends BaseEntity {
    /**
     * @Fields serialVersionUID: long
     * @Desc TODO:
     */
    private static final long serialVersionUID = 1L;
    @Id
    @Column(name = "id", unique = true, nullable = false, length = 32)
    @GeneratedValue(generator="system-uuid")
    @GenericGenerator(name="system-uuid",strategy = "uuid")
    private String id;

    @Column
    private String userId;
    //用户名
    @Column
    private String realName;
    //用户操作
    @Column
    private String operation;
    //请求方法
    @Column
    private String method;
    //请求参数
    @Column (columnDefinition="text")
    private String params;
    //执行时长(毫秒)
    @Column
    private Long time;
    //IP地址
    @Column
    private String ip;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public String getRealName() {
        return realName;
    }

    public void setRealName(String realName) {
        this.realName = realName;
    }

    public String getOperation() {
        return operation;
    }

    public void setOperation(String operation) {
        this.operation = operation;
    }

    public String getMethod() {
        return method;
    }

    public void setMethod(String method) {
        this.method = method;
    }

    public String getParams() {
        return params;
    }

    public void setParams(String params) {
        this.params = params;
    }

    public Long getTime() {
        return time;
    }

    public void setTime(Long time) {
        this.time = time;
    }

    public String getIp() {
        return ip;
    }

    public void setIp(String ip) {
        this.ip = ip;
    }
}
